<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>劲松商城后台</title>
    <div th:include="Admin/public/Common::head"></div>
    <script type="text/javascript">
        $(function (){
            $("#gamename").change(function (){
               var name=this.value;
               $.ajax({
                   url:"http://localhost:8080/admin/checkname",
                   type:"POST",
                   data:{gamename:name},
                   success:function (data){
                       $("span.errorMsg").text(data);
                   }
               })
            })
        })
    </script>
</head>
<body>
<div class="main-wrap">
    <div th:include="Admin/public/Common::menu"></div>
    <div class="content-wrap">
        <div th:replace="Admin/public/Common::header"></div>
        <main class="main-cont content mCustomScrollbar">
            <form th:action="@{/admin/add}" method="post">
            <div class="page-wrap">
                <!--开始::内容-->
                <section class="page-hd">
                    <header>
                        <h2 class="title"><i class="fa  fa-gamepad ">&nbsp;</i>添加游戏</h2>
                        <p class="title-description">
                            在此添加你的游戏哟
                        </p>
                    </header>
                    <hr>
                </section>
                <div class="form-group-col-2">
                    <p><span style="color: red" class="errorMsg"></span></p>
                    <div class="form-label">游戏名称：</div>
                    <div class="form-cont">
                        <input type="text" placeholder="输入游戏名称" class="form-control form-boxed" name="gamename" id="gamename"/>
                    </div>
                </div>
                <div class="form-group-col-2">
                    <div class="form-label">游戏价格：</div>
                    <div class="form-cont">
                        <input type="text" placeholder="游戏价格" class="form-control form-boxed" name="price">
                    </div>
                </div>
                <div class="form-group-col-2">
                    <div class="form-label">游戏平台：</div>
                    <div class="form-cont">
                        <select style="width:auto;" name="platform" id="platform">
                            <option>选择平台</option>
                            <option id="1">pc/xbox/ps4</option>
                            <option id="2">pc/xbox</option>
                            <option id="3">pc/ps4</option>
                            <option id="4">xbox/ps4</option>
                        </select>
                    </div>
                </div>
                <div class="form-group-col-2">
                    <div class="form-label">是否上架：</div>
                    <div class="form-cont">
                        <label class="radio">
                            <input type="radio" name="status" value="1"/>
                            <span>是</span>
                        </label>
                        <label class="radio">
                            <input type="radio" name="status"  checked="checked" value="0"/>
                            <span>否</span>
                        </label>
                    </div>
                </div>
                <div class="form-group-col-2">
                    <div class="form-label">游戏介绍：</div>
                    <div class="form-cont">
                        <textarea class="form-control form-boxed" placeholder="输入该游戏的介绍" name="detail"></textarea>
                    </div>
                </div>
                <div class="form-group-col-2">
                    <div class="form-label"></div>
                    <div class="form-cont">
                        <input type="submit" class="btn btn-primary" value="添加游戏" />
                    </div>
                </div>
                <!--开始::结束-->
            </div>
            </form>
        </main>

    </div>
</div>

<div class="mask"></div>
<div class="dialog">
    <div class="dialog-hd">
        <strong class="lt-title">标题</strong>
        <a class="rt-operate icon-remove JclosePanel" title="关闭"></a>
    </div>
    <div class="dialog-bd">
        <!--start::-->
        <p>这里是基础弹窗,可以定义文本信息，HTML信息这里是基础弹窗,可以定义文本信息，HTML信息。</p>
        <!--end::-->
    </div>
    <div class="dialog-ft">
        <button class="btn btn-info JyesBtn">确认</button>
        <button class="btn btn-secondary JnoBtn">关闭</button>
    </div>
</div>
</body>
</html>
